package com.spring.springv3;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author zhoucq
 * @Date 2025/9/18 8:49
 * @Version 1.0
 * 配置类，等价于spring-service.xml
 * @ComponentScan(basePackages = "com.spring.springv3") 和 @Configuration的原理是一样的，都是在项目启动的时候把
 */
@ComponentScan(basePackages = "com.spring.springv3")
@Configuration
public class SpringConfiguration {
    //bean 相当于 <bean id="springv3Service" class="com.springv3.Springv3Service"> 和 @Service
    @Bean
    public Springv3Service springv3Service() {
        return new Springv3Service();
    }
}
